<?php

class Product extends CI_Model {

    var $product_name   = '';
    var $img_url = '';
    var $description   = '';
    
    function __construct()
    {
        // Call the Model constructor
        parent::__construct();
    }
    function setProductInfo($name,$imgUrl,$description)
    {
        $this->product_name=$name;
        $this->img_url=$imgUrl;
        $this->description=$description;
    }
    function get_data()
    {
        $query = $this->db->get('product');
        return $query->result();
    }

    function insert_product()
    {
        $this->db->insert('product', $this);
    }

    function update_product($id)
    {

        $this->db->update('product', $this, array('id' => $id));
    }

}
?>
